local _, GrifonOvaleScripts = ...

GrifonOvaleScripts.script.DEATHKNIGHT.Attilio = {
	desc = "[5.4] Attilio: Blood",
	code = [[

Define(antimagic_shell 48707)
	SpellInfo(antimagic_shell cd=45)
	SpellInfo(antimagic_shell buff_cdr=cooldown_reduction_strength_buff specialization=frost)
	SpellInfo(antimagic_shell buff_cdr=cooldown_reduction_strength_buff specialization=unholy)
	SpellInfo(antimagic_shell buff_cdr=cooldown_reduction_tank_buff specialization=blood)
Define(army_of_the_dead 42650)
	SpellInfo(army_of_the_dead blood=1 frost=1 unholy=1 cd=600)
	SpellInfo(army_of_the_dead buff_cdr=cooldown_reduction_strength_buff specialization=frost)
	SpellInfo(army_of_the_dead buff_cdr=cooldown_reduction_strength_buff specialization=unholy)
	SpellAddBuff(army_of_the_dead army_of_the_dead_buff=1)
Define(army_of_the_dead_buff 42650)
	SpellInfo(army_of_the_dead_buff duration=40)
Define(asphyxiate 108194)
	SpellInfo(asphyxiate cd=30)
Define(asphyxiate_talent 9)
Define(blood_boil 48721)
	SpellInfo(blood_boil blood=1)
	SpellInfo(blood_boil buff_runes_none=crimson_scourge_buff if_spell=crimson_scourge)
	SpellAddTargetDebuff(blood_boil blood_plague_debuff=refresh frost_fever_debuff=refresh if_spell=scarlet_fever)
Define(blood_charge_buff 114851)
	SpellInfo(blood_charge_buff duration=25 maxstacks=12)
Define(blood_plague 59879)
Define(blood_plague_debuff 55078)
	SpellInfo(blood_plague_debuff duration=30 tick=3)
Define(blood_presence 48263)
Define(blood_tap 45529)
	SpellAddBuff(blood_tap blood_charge_buff=-5)
Define(blood_tap_talent 13)
Define(bone_shield 49222)
	SpellInfo(bone_shield cd=60)
	SpellInfo(bone_shield buff_cdr=cooldown_reduction_tank_buff specialization=blood)
	SpellAddBuff(bone_shield bone_shield_buff=1)
Define(bone_shield_buff 49222)
	SpellInfo(bone_shield_buff duration=300)
Define(crimson_scourge 81136)
Define(crimson_scourge_buff 81141)
	SpellInfo(crimson_scourge_buff duration=15)
Define(dancing_rune_weapon 49028)
	SpellInfo(dancing_rune_weapon cd=90)
	SpellInfo(dancing_rune_weapon buff_cdr=cooldown_reduction_tank_buff specialization=blood)
	SpellAddBuff(dancing_rune_weapon dancing_rune_weapon_buff=1)
Define(dancing_rune_weapon_buff 81256)
	SpellInfo(dancing_rune_weapon_buff duration=12)
Define(dark_simulacrum 77606)
	SpellInfo(dark_simulacrum cd=60)
	SpellInfo(dark_simulacrum addcd=-30 glyph=glyph_of_dark_simulacrum)
Define(dark_simulacrum_buff 77606)
	SpellInfo(dark_simulacrum_buff duration=8)
	SpellInfo(dark_simulacrum_buff addduration=4 glyph=glyph_of_dark_simulacrum)
Define(dark_transformation 63560)
	SpellInfo(dark_transformation unholy=1)
	SpellAddBuff(dark_transformation dark_transformation_buff=1 shadow_infusion_buff=-5)
Define(dark_transformation_buff 63560)
	SpellInfo(dark_transformation_buff duration=30)
Define(death_and_decay 43265)
	SpellInfo(death_and_decay unholy=1 cd=30)
	SpellInfo(death_and_decay buff_runes_none=crimson_scourge_buff if_spell=crimson_scourge)
Define(death_coil 47541)
	SpellInfo(death_coil runicpower=40)
	SpellInfo(death_coil runicpower=32 if_spell=sudden_doom)
	SpellInfo(death_coil buff_runicpower_none=sudden_doom_buff if_spell=sudden_doom)
	SpellAddBuff(death_coil blood_charge_buff=2 talent=blood_tap_talent)
Define(death_grip 49576)
	SpellInfo(death_grip cd=25)
Define(death_pact 48743)
	SpellInfo(death_pact cd=120)
Define(death_pact_talent 10)
Define(death_siphon 108196)
	SpellInfo(death_siphon death=1)
Define(death_siphon_talent 10)
Define(death_strike 49998)
	SpellInfo(death_strike frost=1 unholy=1)
Define(ebon_plaguebringer 51160)
Define(empower_rune_weapon 47568)
	SpellInfo(empower_rune_weapon cd=300 runicpower=-25)
	SpellInfo(empower_rune_weapon buff_cdr=cooldown_reduction_strength_buff specialization=frost)
Define(festering_strike 85948)
	SpellInfo(festering_strike blood=1 frost=1)
Define(frost_fever_debuff 55095)
	SpellInfo(frost_fever_debuff duration=30 tick=3)
Define(frost_presence 48266)
Define(frost_strike 49143)
	SpellInfo(frost_strike runicpower=35)
	SpellInfo(frost_strike runicpower=20 if_spell=improved_frost_presence if_stance=deathknight_frost_presence)
	SpellAddBuff(frost_strike killing_machine_buff=0 if_spell=killing_machine)
	SpellAddBuff(frost_strike blood_charge_buff=2 talent=blood_tap_talent)
Define(glyph_of_dark_simulacrum 63331)
Define(glyph_of_icebound_fortitude 58673)
Define(glyph_of_mind_freeze 58686)
Define(glyph_of_outbreak 59332)
Define(glyph_of_the_loud_horn 146646)
Define(heart_strike 55050)
	SpellInfo(heart_strike blood=1)
Define(horn_of_winter 57330)
	SpellInfo(horn_of_winter cd=20 runicpower=-10)
	SpellInfo(horn_of_winter cd=40 runicpower=-20 glyph=glyph_of_the_loud_horn)
Define(howling_blast 49184)
	SpellInfo(howling_blast frost=1)
	SpellInfo(howling_blast buff_runes_none=rime_buff if_spell=rime)
	SpellAddBuff(howling_blast rime_buff=0 if_spell=rime)
	SpellAddTargetDebuff(howling_blast frost_fever_debuff=1)
Define(icebound_fortitude 48792)
	SpellInfo(icebound_fortitude cd=180)
	SpellInfo(icebound_fortitude cd=90 glyph=glyph_of_icebound_fortitude)
	SpellInfo(icebound_fortitude buff_cdr=cooldown_reduction_strength_buff specialization=frost)
	SpellInfo(icebound_fortitude buff_cdr=cooldown_reduction_strength_buff specialization=unholy)
	SpellInfo(icebound_fortitude buff_cdr=cooldown_reduction_tank_buff specialization=blood)
	SpellAddBuff(icebound_fortitude icebound_fortitude_buff=1)
Define(icebound_fortitude_buff 48792)
	SpellInfo(icebound_fortitude_buff duration=12)
	SpellInfo(icebound_fortitude_buff duration=3 glyph=glyph_of_icebound_fortitude)
Define(icy_touch 45477)
	SpellInfo(icy_touch frost=1)
	SpellInfo(icy_touch buff_runes_none=rime_buff if_spell=rime)
	SpellAddBuff(icy_touch rime_buff=0 if_spell=rime)
	SpellAddTargetDebuff(icy_touch frost_fever_debuff=1)
Define(improved_frost_presence 50385)
Define(killing_machine 51128)
Define(killing_machine_buff 51124)
	SpellInfo(killing_machine_buff duration=10)
Define(master_of_ghouls 52143)
Define(mind_freeze 47528)
	SpellInfo(mind_freeze cd=15)
	SpellInfo(mind_freeze addcd=-1 runicpower=10 glyph=glyph_of_mind_freeze)
Define(obliterate 49020)
	SpellInfo(obliterate frost=1 unholy=1)
	SpellAddBuff(obliterate killing_machine_buff=0 if_spell=killing_machine)
Define(outbreak 77575)
	SpellInfo(outbreak cd=60 glyph=!glyph_of_outbreak)
	SpellInfo(outbreak runicpower=30 glyph=glyph_of_outbreak)
	SpellInfo(outbreak buff_cdr=cooldown_reduction_strength_buff specialization=frost)
	SpellInfo(outbreak buff_cdr=cooldown_reduction_strength_buff specialization=unholy)
	SpellInfo(outbreak buff_cdr=cooldown_reduction_tank_buff specialization=blood)
	SpellAddTargetDebuff(outbreak blood_plague_debuff=1 frost_fever_debuff=1)
Define(pestilence 50842)
	SpellInfo(pestilence blood=1)
Define(pillar_of_frost 51271)
	SpellInfo(pillar_of_frost cd=60 frost=1)
	SpellInfo(pillar_of_frost buff_cdr=cooldown_reduction_strength_buff specialization=frost)
	SpellAddBuff(pillar_of_frost pillar_of_frost_buff=1)
Define(pillar_of_frost_buff 51271)
	SpellInfo(pillar_of_frost duration=20)
Define(plague_leech 123693)
	SpellInfo(plague_leech cd=25)
	SpellAddTargetDebuff(plague_leech blood_plague_debuff=0 frost_fever_debuff=0)
Define(plague_leech_talent 2)
Define(plague_strike 45462)
	SpellInfo(plague_strike unholy=1)
	SpellAddTargetDebuff(plague_strike blood_plague_debuff=1)
	SpellAddTargetDebuff(plague_strike frost_fever_debuff=1 if_spell=ebon_plaguebringer)
Define(raise_dead 46584)
	SpellInfo(raise_dead cd=120)
	SpellInfo(raise_dead addcd=-60 if_spell=master_of_ghouls)
Define(rime 59057)
Define(rime_buff 59052)
	SpellInfo(rime_buff duration=15)
Define(roiling_blood_talent 1)
Define(rune_strike 56815)
	SpellInfo(rune_strike runicpower=30)
	SpellAddBuff(rune_strike blood_charge_buff=2 talent=blood_tap_talent)
Define(rune_tap 48982)
	SpellInfo(rune_tap blood=1 cd=30)
	SpellInfo(rune_tap blood=0 addcd=-10 itemset=T15_tank itemcount=2)
	SpellInfo(rune_tap buff_runes_none=will_of_the_necropolis_buff if_spell=will_of_the_necropolis)
	SpellAddBuff(rune_tap will_of_the_necropolis_buff=0 if_spell=will_of_the_necropolis)
Define(runic_corruption_buff 51460)
	SpellInfo(runic_corruption_buff duration=3)
Define(runic_corruption_talent 15)
Define(runic_empowerment_talent 14)
Define(scarlet_fever 81132)
Define(scourge_strike 55090)
	SpellInfo(scourge_strike unholy=1)
Define(shadow_infusion_buff 91342)
	SpellInfo(shadow_infusion_buff duration=30 maxstacks=5)
Define(soul_reaper_blood 114866)
	SpellInfo(soul_reaper_blood blood=1 cd=6)
	SpellAddBuff(soul_reaper_blood killing_machine_buff=0 if_spell=killing_machine itemset=T15_melee itemcount=4)
Define(soul_reaper_frost 130735)
	SpellInfo(soul_reaper_frost frost=1 cd=6)
	SpellAddBuff(soul_reaper_frost killing_machine_buff=0 if_spell=killing_machine itemset=T15_melee itemcount=4)
Define(soul_reaper_unholy 130736)
	SpellInfo(soul_reaper_unholy unholy=1 cd=6)
	SpellAddBuff(soul_reaper_unholy killing_machine_buff=0 if_spell=killing_machine itemset=T15_melee itemcount=4)
Define(strangulate 47476)
	SpellInfo(strangulate blood=1 cd=60)
Define(sudden_doom 49530)
Define(sudden_doom_buff 81340)
	SpellInfo(sudden_doom_buff duration=10)
Define(summon_gargoyle 49206)
	SpellInfo(summon_gargoyle cd=180)
	SpellInfo(summon_gargoyle buff_cdr=cooldown_reduction_strength_buff specialization=unholy)
Define(unholy_blight 115989)
	SpellInfo(unholy_blight cd=90)
Define(unholy_blight_talent 3)
Define(unholy_frenzy 49016)
	SpellInfo(unholy_frenzy cd=180)
	SpellInfo(unholy_frenzy buff_cdr=cooldown_reduction_strength_buff specialization=unholy)
Define(unholy_presence 48265)
Define(vampiric_blood 55233)
	SpellInfo(vampiric_blood cd=60)
	SpellInfo(vampiric_blood addcd=-10 itemset=T14_tank itemcount=2)
	SpellInfo(vampiric_blood buff_cdr=cooldown_reduction_tank_buff specialization=blood)
	SpellAddBuff(vampiric_blood vampiric_blood_buff=1)
Define(vampiric_blood_buff 55233)
	SpellInfo(vampiric_blood_buff duration=10)
Define(will_of_the_necropolis 81164)
Define(will_of_the_necropolis_buff 96171)
	SpellInfo(will_of_the_necropolis_buff duration=8)

Define(ICEBOUNDFORTITUDE 48792)
    SpellInfo(ICEBOUNDFORTITUDE cd=180)
    SpellAddBuff(ICEBOUNDFORTITUDE ICEBOUNDFORTITUDE=18)

Define(DEATHPACT 48743)
    SpellInfo(DEATHPACT cd=120)

Define(ANTIMACIC 48707)
    SpellInfo(ANTIMACIC cd=45)

Define(asphyxiate_talent 9)
Define(blood_tap_talent 13)
Define(desecrated_ground_talent 18)
Define(gorefiends_grasp_talent 16)
Define(plague_leech_talent 2)
Define(remorseless_winter_talent 17)
Define(roiling_blood_talent 1)
Define(unholy_blight_talent 3)

Define(glyph_of_outbreak 59332)

AddCheckBox(AutoInterrupt "AutoInterrupt" default)
AddCheckBox(AutoDancingRune "AutoDancingRune" default)
AddCheckBox(AutoDeathAndDecay "AutoDeathAndDecay" default)
AddCheckBox(AutoAOE "AutoAOE" default)
AddCheckBox(AutoDefence "AutoDefence" default)
AddCheckBox(AutoEmpowerRuneWeapon "AutoEmpowerRuneWeapon" default)


#VampiricBloodHP
AddListItem(VampiricBloodHP vb0   "VampiricBloodHP 0")
AddListItem(VampiricBloodHP vb2  "VampiricBloodHP 20")
AddListItem(VampiricBloodHP vb3  "VampiricBloodHP 30")
AddListItem(VampiricBloodHP vb4  "VampiricBloodHP 40")
AddListItem(VampiricBloodHP vb5  "VampiricBloodHP 50")
AddListItem(VampiricBloodHP vb6  "VampiricBloodHP 60")
AddListItem(VampiricBloodHP vb7  "VampiricBloodHP 70" default)
AddListItem(VampiricBloodHP vb8  "VampiricBloodHP 80" )
AddListItem(VampiricBloodHP vb9  "VampiricBloodHP 90")
AddListItem(VampiricBloodHP vb10  "VampiricBloodHP 100")


AddFunction VampiricBloodHPValue asValue=1
{
	if List(VampiricBloodHP vb0) 0
	if List(VampiricBloodHP vb2) 20
        if List(VampiricBloodHP vb3) 30
	if List(VampiricBloodHP vb4) 40
	if List(VampiricBloodHP vb5) 50
	if List(VampiricBloodHP vb6) 60
	if List(VampiricBloodHP vb7) 70
	if List(VampiricBloodHP vb8) 80
	if List(VampiricBloodHP vb9) 90
	if List(VampiricBloodHP vb10) 101  
}

#IceBoundFortitudeHP
AddListItem(IceBoundFortitudeHP ibf0   "IceBoundFortitudeHP 0")
AddListItem(IceBoundFortitudeHP ibf2  "IceBoundFortitudeHP 20")
AddListItem(IceBoundFortitudeHP ibf3  "IceBoundFortitudeHP 30" default)
AddListItem(IceBoundFortitudeHP ibf4  "IceBoundFortitudeHP 40")
AddListItem(IceBoundFortitudeHP ibf5  "IceBoundFortitudeHP 50")
AddListItem(IceBoundFortitudeHP ibf6  "IceBoundFortitudeHP 60")
AddListItem(IceBoundFortitudeHP ibf7  "IceBoundFortitudeHP 70")
AddListItem(IceBoundFortitudeHP ibf8  "IceBoundFortitudeHP 80")
AddListItem(IceBoundFortitudeHP ibf9  "IceBoundFortitudeHP 90")
AddListItem(IceBoundFortitudeHP ibf10  "IceBoundFortitudeHP 100")


AddFunction IceBoundFortitudeHPValue asValue=1
{
	if List(IceBoundFortitudeHP ibf0) 0
	if List(IceBoundFortitudeHP ibf2) 20
        if List(IceBoundFortitudeHP ibf3) 30
	if List(IceBoundFortitudeHP ibf4) 40
	if List(IceBoundFortitudeHP ibf5) 50
	if List(IceBoundFortitudeHP ibf6) 60
	if List(IceBoundFortitudeHP ibf7) 70
	if List(IceBoundFortitudeHP ibf8) 80
	if List(IceBoundFortitudeHP ibf9) 90
	if List(IceBoundFortitudeHP ibf10) 101 
}

#RaiseDeadHP
AddListItem(RaiseDeadHP rd0   "RaiseDeadHP 0")
AddListItem(RaiseDeadHP rd2  "RaiseDeadHP 20")
AddListItem(RaiseDeadHP rd3  "RaiseDeadHP 30" default)
AddListItem(RaiseDeadHP rd4  "RaiseDeadHP 40")
AddListItem(RaiseDeadHP rd5  "RaiseDeadHP 50")
AddListItem(RaiseDeadHP rd6  "RaiseDeadHP 60")
AddListItem(RaiseDeadHP rd7  "RaiseDeadHP 70")
AddListItem(RaiseDeadHP rd8  "RaiseDeadHP 80")
AddListItem(RaiseDeadHP rd9  "RaiseDeadHP 90")
AddListItem(RaiseDeadHP rd10  "RaiseDeadHP 100")


AddFunction RaiseDeadHPValue asValue=1
{
	if List(RaiseDeadHP rd0) 0
	if List(RaiseDeadHP rd2) 20
        if List(RaiseDeadHP rd3) 30
	if List(RaiseDeadHP rd4) 40
	if List(RaiseDeadHP rd5) 50
	if List(RaiseDeadHP rd6) 60
	if List(RaiseDeadHP rd7) 70
	if List(RaiseDeadHP rd8) 80
	if List(RaiseDeadHP rd9) 90
	if List(RaiseDeadHP rd10) 101  
}

#DeathPactHP
AddListItem(DeathPactHP dp0   "DeathPactHP 0")
AddListItem(DeathPactHP dp2  "DeathPactHP 20")
AddListItem(DeathPactHP dp3  "DeathPactHP 30" default)
AddListItem(DeathPactHP dp4  "DeathPactHP 40")
AddListItem(DeathPactHP dp5  "DeathPactHP 50")
AddListItem(DeathPactHP dp6  "DeathPactHP 60")
AddListItem(DeathPactHP dp7  "DeathPactHP 70")
AddListItem(DeathPactHP dp8  "DeathPactHP 80")
AddListItem(DeathPactHP dp9  "DeathPactHP 90")
AddListItem(DeathPactHP dp10  "DeathPactHP 100")


AddFunction DeathPactHPValue asValue=1
{
	if List(DeathPactHP dp0) 0
	if List(DeathPactHP dp2) 20
        if List(DeathPactHP dp3) 30
	if List(DeathPactHP dp4) 40
	if List(DeathPactHP dp5) 50
	if List(DeathPactHP dp6) 60
	if List(DeathPactHP dp7) 70
	if List(DeathPactHP dp8) 80
	if List(DeathPactHP dp9) 90
	if List(DeathPactHP dp10) 101  
}

#RuneTapHP
AddListItem(RuneTapHP rt0   "RuneTapHP 0")
AddListItem(RuneTapHP rt2  "RuneTapHP 20")
AddListItem(RuneTapHP rt3  "RuneTapHP 30")
AddListItem(RuneTapHP rt4  "RuneTapHP 40")
AddListItem(RuneTapHP rt5  "RuneTapHP 50")
AddListItem(RuneTapHP rt6  "RuneTapHP 60")
AddListItem(RuneTapHP rt7  "RuneTapHP 70")
AddListItem(RuneTapHP rt8  "RuneTapHP 80" default)
AddListItem(RuneTapHP rt9  "RuneTapHP 90")
AddListItem(RuneTapHP rt10  "RuneTapHP 100")


AddFunction RuneTapHPValue asValue=1
{
	if List(RuneTapHP rt0) 0
	if List(RuneTapHP rt2) 20
        if List(RuneTapHP rt3) 30
	if List(RuneTapHP rt4) 40
	if List(RuneTapHP rt5) 50
	if List(RuneTapHP rt6) 60
	if List(RuneTapHP rt7) 70
	if List(RuneTapHP rt8) 80
	if List(RuneTapHP rt9) 90
	if List(RuneTapHP rt10) 101  
}

#AOERotationnummobs
AddListItem(AOERotationnummobs aoe1  "AOERotationnummobs 1")
AddListItem(AOERotationnummobs aoe2  "AOERotationnummobs 2")
AddListItem(AOERotationnummobs aoe3  "AOERotationnummobs 3" default)
AddListItem(AOERotationnummobs aoe4  "AOERotationnummobs 4")
AddListItem(AOERotationnummobs aoe5  "AOERotationnummobs 5")
AddListItem(AOERotationnummobs aoe6  "AOERotationnummobs 6")
AddListItem(AOERotationnummobs aoe7  "AOERotationnummobs 7")
AddListItem(AOERotationnummobs aoe8  "AOERotationnummobs 8")
AddListItem(AOERotationnummobs aoe9  "AOERotationnummobs 9")
AddListItem(AOERotationnummobs aoe10 "AOERotationnummobs 10")


AddFunction AOERotationnummobsValue asValue=1
{
	if List(AOERotationnummobs aoe1) 1
	if List(AOERotationnummobs aoe2) 2
        if List(AOERotationnummobs aoe3) 3
	if List(AOERotationnummobs aoe4) 4
	if List(AOERotationnummobs aoe5) 5
	if List(AOERotationnummobs aoe6) 6
	if List(AOERotationnummobs aoe7) 7
	if List(AOERotationnummobs aoe8) 8
	if List(AOERotationnummobs aoe9) 9
	if List(AOERotationnummobs aoe10) 10
}


AddIcon specialization=1 help=main
{
    Interrupt()
    if not BuffPresent (bone_shield) Spell(bone_shield)
    if {{TalentPoints(plague_leech_talent) and target.DebuffPresent(frost_fever_debuff) and target.DebuffPresent(blood_plague_debuff) and {target.DebuffRemains(frost_fever_debuff) <4 or target.DebuffRemains(blood_plague_debuff) <4}} and {{RuneCount(unholy) <1 or RuneCount(frost) <1} or RuneCount(death) <1 }} Spell(plague_leech)
    
    if {target.DebuffRemains(frost_fever_debuff) < 2 or target.DebuffRemains(blood_plague_debuff) < 2}
    {
	Spell(outbreak)
    }
    
       
    if {TalentPoints(blood_tap_talent) and BuffStacks(blood_charge) >=5} and RuneCount(death) <1  Spell(blood_tap)
    if CheckBoxOn(AutoEmpowerRuneWeapon) and RuneCount(death) <1 and RuneCount(blood) <1 and RuneCount(frost) <1 and RuneCount(unholy) <1 and RunicPower() < 30 Spell(empower_rune_weapon)
    
    if CheckBoxOn(AutoDefence) Autocure()

    if CheckBoxOn(AutoAOE) and Enemies() >= AOERotationnummobsValue()  FullAOE()

    if target.DebuffRemains(frost_fever_debuff) < 2 Spell(icy_touch)
    if target.DebuffRemains(blood_plague_debuff) < 2 Spell(plague_strike)
    if BuffRemains(blood_shield) < 2 Spell(death_strike)
    if target.HealthPercent() <=35 and {RuneCount(blood) >=1 and RunicPower() <90} Spell(soul_reaper_blood)
    
    if RunicPower() >=60 and CheckBoxOn(AutoDancingRune) Spell(dancing_rune_weapon)
    if RuneCount(blood) >=1 and RunicPower() <90 Spell(heart_strike)
    if BuffPresent(crimson_scourge) Spell(blood_boil)
    if {{RuneCount(unholy) >=1 or RuneCount(frost) >=1} and {RuneCount(death) >=1 }} or {RuneCount(unholy) >=1 and RuneCount(frost) >=1} Spell(death_strike)
    if RuneCount(death) >=2 Spell(death_strike)
    Spell(horn_of_winter)
    Spell(rune_strike)
    if CheckBoxOn(AutoDeathAndDecay) and {RuneCount(unholy) >=1 or RuneCount(death) >=1 or BuffPresent(crimson_scourge)} Spell(death_and_decay)
}

AddFunction FullAOE
{
    
    if target.DebuffRemains(frost_fever_debuff) < 2 Spell(icy_touch)
    if target.DebuffRemains(blood_plague_debuff) < 2 Spell(plague_strike)
    if BuffRemains(blood_shield) < 2 Spell(death_strike)
    
    if RunicPower() >=60 and CheckBoxOn(AutoDancingRune) Spell(dancing_rune_weapon)
    if CheckBoxOn(AutoDeathAndDecay) and {RuneCount(unholy) >=1 or RuneCount(death) >=1 or BuffPresent(crimson_scourge)} Spell(death_and_decay)
    if RuneCount(blood) >=1 and RunicPower() <90 Spell(blood_boil)
    if BuffPresent(crimson_scourge) Spell(blood_boil)
    if {{RuneCount(unholy) >=1 or RuneCount(frost) >=1} and {RuneCount(death) >=1 }} or {RuneCount(unholy) >=1 and RuneCount(frost) >=1} Spell(death_strike)
    if RuneCount(death) >=2 Spell(death_strike)
    Spell(horn_of_winter)
    if RunicPower() >=30 Spell(rune_strike usable=1)
    

}


AddFunction Autocure
{
	if player.HealthPercent() <= VampiricBloodHPValue() Spell(vampiric_blood)
	if player.HealthPercent() <= IceBoundFortitudeHPValue() Spell(ICEBOUNDFORTITUDE)
	if player.HealthPercent() <= RaiseDeadHPValue() Spell(raise_dead)
	if player.HealthPercent() <= DeathPactHPValue() and TotemPresent(ghoul) Spell(DEATHPACT)
	if RuneCount(blood) >=1 and player.HealthPercent() <= RuneTapHPValue() Spell(rune_tap usable=1)
	Spell(ANTIMACIC)
}

AddFunction Interrupt
{
	if CheckBoxOn(AutoInterrupt) and {target.IsFriend(no) or {target.IsFriend() and target.IsCharmed()} } and target.IsInterruptible()
	{
		Spell(mind_freeze)
		if not TalentPoints(asphyxiate_talent) Spell(strangulate)
    		if TalentPoints(asphyxiate_talent) Spell(asphyxiate)
	}
}







]],
}
